<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
   <title>ContextMenuControl Documentation: Examples</title>
   <link rel="stylesheet" type="text/css" href="http://code.google.com/css/codesite.css"></link>
   <link rel="stylesheet" type="text/css" href="http://gmaps-utility-library.googlecode.com/svn/trunk/util/docs/template/local_extensions.css"></link>
   <script type="text/javascript" src="http://code.google.com/js/prettify.js"></script>
  </head>
  <body onload="prettyPrint()">
<h1><a name="ContextMenuControl_HowTo" id="ContextMenuControl_HowTo"></a>ContextMenuControl Examples</h1>
<p>
ContextMenuControl lets you add a comfortable context menu with just one line of code. The control is easy to embed because it doesn't require an extra panel. Instead of using a panel for displaying direction details the steps are shown in infowindows. It is possible to add up to 25 destinations for direction queries. All direction markers are draggable and removable in any order. ContextMenuControl can be invoked with or without any options. When no options are are used, all available items of the control will be shown. </p>
<pre class="prettyprint">
  var map = new GMap2(document.getElementById("map"));
  map.setCenter(new GLatLng(37.437657, -122.157841), 12);
  map.addControl(new ContextMenuControl());
</pre>

<p>
<a href="../examples/simple.html">View example (simple.html).</a>
</p>

<h2>Excluding items</h2>
<p>ContextMenuControl currently offers the following six items to display in the context menu:'Directions from here', 'Directions to here', 'Zoom In', 'Zoom Out', 'Center Map here', and 'What's here?'. Every item provides its own functionality. By specifying one of <a href="reference.html"> ContextMenuControlOptions</a> and setting its value to <i>false</i> you can exclude particular items of the context menu. Every item can be excluded separately. The example code below shows how to exclude the 'What's here? item:</p>
<pre class="prettyprint">
  var map = new GMap2(document.getElementById("map"));
  map.setCenter(new GLatLng(37.437657, -122.157841), 12);
  var opts = { whatsHere: false };
  map.addControl(new ContextMenuControl( opts ));
</pre>
<p>
<a href="../examples/withoutWhatshere.html">View example (withoutWhatshere.html).</a>
</p>

<p>&nbsp;</p>

</body>
</html>
